/**
 * Created by Administrator on 2017/4/17.
 */
//基本面向对象
var demo={
    name:'demo',
    time:new Date(),
    func:function(e){
        return (new Date().getTime()+';'+e)
    }
};
console.log(demo.name);
console.log(demo.time);
console.log(demo.func('Tokky'))

//函数构造器
function demo2(){

}
demo2.prototype={
    name:'demo2',
    time:new Date(),
    func:function(e){
        return (new Date().getTime()+';'+e)
    }
}//原型链
    //必须创建对象
    var oo =new demo2();
console.log(oo.name);
console.log(oo.time);
console.log(oo.func('Tokky2'));

